<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : rt_100_05K.jsp
    Description : 커뮤니티 사용자 등록 폼.
    author EUNGA
    since 2012. 8. 17.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 8. 17.     EUNGA     최초 생성
--%>
<%@ include file="/WEB-INF/jsp/co/us/include/declare.jspf" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>현대자동차 CSR &#124; 공모사업 커뮤니티</title>
<meta name="description" content="" />
<meta name="keywords" content="" />
<%@ include file="/WEB-INF/jsp/co/us/include/header.jspf" %>
<script type="text/javaScript" language="javascript">

$(document).ready(function() {    
    /* form validation check */
    onloadCharCheck();
     
    /* List Page 이동 */
    $("#listButn").bind("click", moveListPage);
    /* Form Submit */
    $("#rgstButn").bind("click", blcSubm);
    /* Form 초기화 */
    $("#cnclButn").bind("click", formIniz);
});

/*
 * 리스트페이지 이동
 */
function moveListPage() {
    var listUrl = "/rt_100_03.do";
    if("Image" == "${rqInfo.listType}"){
        listUrl = "/rt_100_02.do";
    }
    $("#hiddenForm").attr('action',listUrl).submit();
}

/*
 * Form Submit
 */
function blcSubm() {
    if (!validateForm($("#mainForm"))) {
        return;
    }
    
    if (!isSchrChk($("#titl").val())) {
        alert("[제목] 은 특수문자(!#$%^&*|'<>-;)를 입력할 수 없습니다.");
        $("#titl").focus();
        return;
    }
    
    if (getTxtBkmgRmov($("#sbc").val())=="") {
        alert("[내용] 을 입력해주세요.");
        $("#sbc").focus();
        return;
    }
    
    $("#mainForm").attr('target','comIframe');
    $("#mainForm").attr('action','/rt_100_06.do');
    $("#mainForm").submit();
}  

/*
 * Form 초기화
 */
function formIniz() {
    $("form").each(function(){
       this.reset(); 
    });
}
</script>
</head>
<body>
<div id="wrap">
    <!-- top -->
    <%@ include file="/WEB-INF/jsp/co/us/include/top.jsp" %>
    <!-- top -->

    <!-- container -->
    <div id="container">
        <div id="contentsWrap">
            <div id="contentsArea">
                <div class="headingArea">
                    <div class="location">
                        <a href="/ma_100_01.do">홈</a>
                        <a href="/rt_100_01.do">사회공헌</a>
                        <a href="/rt_100_01.do">공모사업</a>
                        <span>공모사업 커뮤니티</span>
                    </div>
                    <h2>공모사업</h2>
                    <ul class="menuTab">
                        <li><h3><a href="/rt_100_01.do">사업소개</a></h3></li>
                        <li class="atv"><h3><a href="/rt_100_02.do">공모사업 커뮤니티</a></h3></li>
                    	<li><h3><a href="/rt_100_31.do">FAQ</a></h3></li>
					</ul>
                </div>
                <form id="hiddenForm" name="hiddenForm" method="post">
                    <input type="hidden" id="blbIdx" name="blbIdx" value="${result.blbIdx }" />
                    <input type="hidden" id="currentPageNo" name="currentPageNo" value="${rqInfo.currentPageNo }" />
                    <input type="hidden" id="srchScn" name="srchScn" value="${rqInfo.srchScn }" />
                    <input type="hidden" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt }" />
                    <input type="hidden" id="listType" name="listType" value="${rqInfo.listType }" />
                </form>
                <div id="contetns" class="businessCommunity">
                <form id="mainForm" name="mainForm" method="post" enctype="multipart/form-data">
                    <input type="hidden" id="srchScn" name="srchScn" value="${rqInfo.srchScn }" />
                    <input type="hidden" id="srchTxt" name="srchTxt" value="${rqInfo.srchTxt }" />
                    <input type="hidden" id="listType" name="listType" value="${rqInfo.listType }" />
                    <table border="1" class="tableData" summary="공모사업 커뮤니티의 기관명, 작성자, 등록일, 조회수, 이메일, 제목, 첨부파일 등이 기재 되어있는 표">
                        <col width="20%" />
                        <col width="30%" />
                        <col width="20%" />
                        <col width="30%" />
                        <tbody>
                            <tr>
                                <td class="subThead">기관명</td>
                                <td>${instNm }</td>
                                <td class="subThead depth">작성자</td>
                                <td>${userNm }</td>
                            </tr>
                            <tr>
                                <td class="subThead">제목</td>
                                <td colspan="3"><input type="text" id="titl" name="titl" value="" title="제목" nullable="true"  minbyte="2" maxlength="200" /></td>
                            </tr>
                            <tr>
                                <td class="subThead">첨부파일</td>
                                <td colspan="3">
                                    <div class="attachArea">
                                        <p><input name="attcFile" type="file" size="27" /></p>
                                        <p class="attach"><span>[10MB이하]</span> ppt, pptx, ppts, xls, xlsx, hwp, doc, docx, pdf 파일 업로드 가능</p>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td class="subThead">이미지첨부</td>
                                <td colspan="3">
                                    <div class="attachArea">
                                        <p><input name="attcImage" type="file" size="27" /></p>
                                        <p class="attach">이미지 최적화 사이즈는 510*360px입니다. 10MB이상의 파일은 업데이트 시 정상적으로 등록되지 않을 수 있습니다.</p>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" class="dataView">
                                    <textarea id="sbc" name="sbc" rows="10" cols="125"></textarea>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    </form>
                    <div class="btnArea down">
                        <span class="flow"><a id="listButn" name="listButn" href="#"><img src="/img/usr/btn/btn_list.gif" alt="목록" /></a></span>
                        <span class="reverse">
                            <input type="image" id="rgstButn" name="rgstButn" src="/img/usr/btn/btn_register.gif" title="등록" alt="등록" />
                            <a href="#" id="cnclButn" name="cnclButn" ><img src="/img/usr/btn/btn_cancel.gif" alt="취소" /></a>
                        </span>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /container -->

    <!-- footer -->
    <%@ include file="/WEB-INF/jsp/co/us/include/bottom.jsp" %>
    <!-- /footer -->
</div>
</body>
</html>

